package com.tsy.server.system.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tsy.server.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户实体类
 */
@Data
@TableName("user")
@ApiModel(value = "用户实体", description = "用户数据库实体类")
public class User extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名", example = "zhangsan")
    private String username;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码", example = "$2a$10$aSZTvMOD0gzgJnhj3qZ5IO3LL/1Rx6LQCzZi/9yBJ6KmP/U5Jdpwi", notes = "加密后的密码")
    private String password;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱", example = "zhangsan@qq.com")
    private String email;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称", example = "张三")
    private String nickname;

    /**
     * 头像
     */
    @ApiModelProperty(value = "头像URL", example = "https://example.com/avatar.jpg")
    private String avatar;

    /**
     * 状态：0-禁用，1-启用
     */
    @ApiModelProperty(value = "状态：0-禁用，1-启用", example = "1")
    private Integer status;

    /**
     * 用户当前组织ID
     */
    @ApiModelProperty(value = "用户当前组织ID", example = "1")
    private Long currentOrgId;

    /**
     * 最后登录时间
     */
    @ApiModelProperty(value = "最后登录时间", example = "2023-01-01 12:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastLoginTime;

}